/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.sanjose.proyectopatpro.entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Joverxito
 */
@Entity
@Table(name = "Canal", catalog = "BDSanJose", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "Canal.findAll", query = "SELECT c FROM Canal c"),
    @NamedQuery(name = "Canal.findByIdCanal", query = "SELECT c FROM Canal c WHERE c.idCanal = :idCanal"),
    @NamedQuery(name = "Canal.findByDescripcionCanal", query = "SELECT c FROM Canal c WHERE c.descripcionCanal = :descripcionCanal"),
    @NamedQuery(name = "Canal.findByNumeroTransmicion", query = "SELECT c FROM Canal c WHERE c.numeroTransmicion = :numeroTransmicion")})
public class Canal implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "idCanal", nullable = false)
    private Integer idCanal;
    @Basic(optional = false)
    @Column(name = "descripcionCanal", nullable = false, length = 50)
    private String descripcionCanal;
    @Basic(optional = false)
    @Column(name = "numeroTransmicion", nullable = false)
    private int numeroTransmicion;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idCanal")
    private List<PaqueteCanal> paqueteCanalList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idCanal")
    private List<ProgramacionCanal> programacionCanalList;

    public Canal() {
    }

    public Canal(Integer idCanal) {
        this.idCanal = idCanal;
    }

    public Canal(Integer idCanal, String descripcionCanal, int numeroTransmicion) {
        this.idCanal = idCanal;
        this.descripcionCanal = descripcionCanal;
        this.numeroTransmicion = numeroTransmicion;
    }

    public Integer getIdCanal() {
        return idCanal;
    }

    public void setIdCanal(Integer idCanal) {
        this.idCanal = idCanal;
    }

    public String getDescripcionCanal() {
        return descripcionCanal;
    }

    public void setDescripcionCanal(String descripcionCanal) {
        this.descripcionCanal = descripcionCanal;
    }

    public int getNumeroTransmicion() {
        return numeroTransmicion;
    }

    public void setNumeroTransmicion(int numeroTransmicion) {
        this.numeroTransmicion = numeroTransmicion;
    }

    public List<PaqueteCanal> getPaqueteCanalList() {
        return paqueteCanalList;
    }

    public void setPaqueteCanalList(List<PaqueteCanal> paqueteCanalList) {
        this.paqueteCanalList = paqueteCanalList;
    }

    public List<ProgramacionCanal> getProgramacionCanalList() {
        return programacionCanalList;
    }

    public void setProgramacionCanalList(List<ProgramacionCanal> programacionCanalList) {
        this.programacionCanalList = programacionCanalList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCanal != null ? idCanal.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Canal)) {
            return false;
        }
        Canal other = (Canal) object;
        if ((this.idCanal == null && other.idCanal != null) || (this.idCanal != null && !this.idCanal.equals(other.idCanal))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.sanjose.proyectopatpro.entity.Canal[ idCanal=" + idCanal + " ]";
    }
    
}
